package 结构型设计模式.策略模式.demo;

/**
 * @Author lf
 * @Date 3/23/2024
 */
public class StrategyPatternDemo {
    public static void main(String[] args) {
        GreetingContext context = new GreetingContext();

        context.setStrategy(new CasualGreetingStrategy());
        context.executeStrategy("John");

        context.setStrategy(new FormalGreetingStrategy());
        context.executeStrategy("John");
    }
}
